Using Change Context with Statistical Learning for API Code Recommendation

نویسندگان

  • Anh Nguyen
  • Michael Hilton
  • Mihai Codoban
  • Hoan Nguyen
  • Lily Mast
  • Eli Rademacher
  • Tien Nguyen
  • Danny Dig
چکیده

Learning and remembering how to use APIs is hard. While codecompletion tools list all the API methods available on a given object, reading through a long list of API method names and their associated documentation is tedious, and users can be easily overloaded with too many suggestions. While several researchers proposed techniques for recommending APIs, their accuracy is low. We present a novel API recommendation approach that taps into the predictive power of repetitive code changes. Our approach and tool, APIREC, is based on statistical learning from fine-grained code changes and from the context in which those changes were made. We trained APIREC on 43M changes from 100K commits in open-source projects. Our empirical evaluation shows that APIREC correctly recommends an API method in the first position 59% of the time, and it recommends the correct API method in the top 5 positions 75% of the time. This is a significant improvement over the best in class state of the art recommender by a factor of 2.4x for the first position, and 2.2x for the top 5 positions, respectively.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Effective and efficient reuse with software libraries

Research in software engineering has shown that software reuse positively affects the competitiveness of an organization: the productivity of the development team is increased, the time-to-market is reduced, and the overall quality of the resulting software is improved. Today’s code repositories on the Internet provide a large number of reusable software libraries with a variety of functionalit...

متن کامل

Developing a Recommendation Framework for Tourist by Mining Geo-tag Photos (Case Study Tehran District 6)

With the increasing popularity of sharing media on social networks and facilitating access to location technologies, such as Global Positioning System (GPS), people are more interested to share their own photos and videos. The world wide web users are no longer the sole consumer but they are producers of information also, hence a wealth of information are available on web 2.0 applications. The ...

متن کامل

Mining API Usage Patterns by Applying Method Categorization to Improve Code Completion

Developers often face difficulties while using APIs. API usage patterns can aid them in using APIs efficiently, which are extracted from source code stored in software repositories. Previous approaches have mined repositories to extract API usage patterns by simply applying data mining techniques to the collection of method invocations of API objects. In these approaches, respective functional ...

متن کامل

An on-line evaluation framework for recommender systems

Several techniques are currently used to evaluate recommender systems. These techniques involve off-line analysis using evaluation methods from machine learning and information retrieval. We argue that while off-line analysis is useful, user satisfaction with a recommendation strategy can only be measured in an on-line context. We propose a new evaluation framework which involves a paired test ...

متن کامل

TSINGHUA SCIENCE AND TECHNOLOGY Ontology-driven Mashup Auto-completion on the Data API Network

Abstract: This paper presents an ontology-driven mashup auto-completion system that consists of two technical components: building a data API network and ontology-driven mashup auto-completion on this network. A Microformats-based ontology is firstly defined to describe attributes and activities of data APIs. A semantic subgraph template is proposed to describe all three types of information so...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015